<!DOCTYPE html>
<html>
<head>
<title>index</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<!-- <script src="https://code.jquery.com/jquery-1.12.4.js"></script> -->
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
</head>
<script>

    base_url = "http://192.168.101.18:20000"
    window.onload=function(){
        $(function(){
            $.ajax({
                method: "get",
                url: base_url+"/getData/videoData.json",
                dataType: "json",
                success: function(data){
                    
                    var str="<ul>";
                    $.each(data,function(i,items){

                        // console.log(items.videoPath)
                        // 字符串拼接 含有特殊字符的时候 太难拼了
                        str+="<button type='button' onclick='jump(\""+items.videoPath+"\")'>"+items.videoName+"</button>";
                        // str+="<button type='button' onclick='jump(123)'>"+items.videoName+"</button>";
                        str+="<br>";
                        // str+="<li><img height='400' width='600' src='"+base_url+'/hls'+items.videoImg+"'/></li>";
                        
                    })
                    str+="</ul>";
                    $("div").append(str)
                }
            })
        })
    }

    function jump(path){
        console.log(path)
        url = "video.html?path="+path;
        window.location.href=url
    }

    
</script>
<body>

<div>
</div>

</body>
</html>
